import time
from usart_stm32.usart import get_car_data, send_car_data
from usart_stm32.usart_config import ser
from server_api import *
from calculate.car_operator import *
from calculate.car_direction import *

server = 'http://localhost:5000'
car_id = 1
car_pt = '116.347589,39.860927'  # 从stm32获取
i_temp = 7788
i_hum = 8877

oid = 1
warning_flag = 1
# 接收车子数据测试
if __name__ == "__main__":
    print('begin...')
    while True:
        car_pt, i_temp, i_hum, warning_flag = get_car_data()
        print(f"point:{car_pt}, temp:{i_temp}, hum:{i_hum}, warning:{warning_flag}")
        time.sleep(1)



